|
STEP 5: Tiny Little Strips
|
The Beatnik Player has the unique feature of being able to play multiple music and audio files at the same time. While each player instance can only play one file, it is possible to embed multiple Beatnik Player instances on the same HTML page, each with its own SRC file. You can have as many of these player instances on the HTML page as you wish, but up to eight can play together at the same time.
Now, say for instance you were a composer and you wished to create an HTML page where visitors could preview the many RMF compositions you had created. To achieve this, you could embed multiple Beatnik Player instances on the same page. But, in its default control panel layout, the Beatnik Player takes up a fair amount of room - 144 pixels wide by 60 pixels high. This is where the ability to customize the control panel layout comes in handy. The Beatnik Player offers several options for changing aspects of the control panel layout, all of which can be set in the EMBED tag by using the player's supported Embedding Properties.
The particular layout mode that is of interest to us can best bedescribed as a 'tiny little strip' - no more than 15 pixels high and perfect for use in a table layout. Take a look at the sample below...
| "Ambient" by Brian Salter | |
| "Classical" arranged by Brian Salter | |
| "Jungle" by Brian Salter | |
| "Lounge" by Brian Salter | |
| "Modern Rock" by Paul Sebastien |
In this layout, we have placed multiple Beatnik player instances, each loading its own SRC file. The song title for each is placed alongside the accompanying player in the table layout. The user can now listen to the files by clicking on the play buttons on the different control panels. Note that there is no intelligent connection between the different player instances - they each operate independently and can, as a result, be played at the same time resulting in a bit of musical chaos. The user will have to stop each player once they are finished listening to the song and only then start a different song playing. There is a way that one can 'wire' together multiple player instances on a page so that they become mutually exclusive. See the Mutually Exclusive Players example in the Using Player Callbacks tutorial.
Now, let's look at the HTML source...
<CENTER>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=6>
<TR BGCOLOR=EEEEEE>
<TD>
"<B>Ambient</B>" by Brian Salter
</TD>
<TD>
<EMBED
SRC="ambient.rmf"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=15
DISPLAY=SONG
AUTOSTART=FALSE
LOOP=FALSE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
</TD>
</TR>
<TR BGCOLOR=DDDDDD>
<TD>
"<B>Classical</B>" arranged by Brian Salter
</TD>
<TD>
<EMBED
SRC="classical.rmf"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=15
DISPLAY=SONG
AUTOSTART=FALSE
LOOP=FALSE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
</TD>
</TR>
<TR BGCOLOR=CCCCCC>
<TD>
"<B>Jungle</B>" by Brian Salter
</TD>
<TD>
<EMBED
SRC="jungle.rmf"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=15
DISPLAY=SONG
AUTOSTART=FALSE
LOOP=FALSE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
</TD>
</TR>
<TR BGCOLOR=BBBBBB>
<TD>
"<B>Lounge</B>" by Brian Salter
</TD>
<TD>
<EMBED
SRC="lounge.rmf"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=15
DISPLAY=SONG
AUTOSTART=FALSE
LOOP=FALSE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
</TD>
</TR>
<TR BGCOLOR=AAAAAA>
<TD>
"<B>Modern Rock</B>" by Paul Sebastien
</TD>
<TD>
<EMBED
SRC="modern-rock.rmf"
TYPE="audio/rmf"
WIDTH=144
HEIGHT=15
DISPLAY=SONG
AUTOSTART=FALSE
LOOP=FALSE
PLUGINSPAGE="http://www.beatnik.com/to/?player"
>
</TD>
</TR>
</TABLE>
</CENTER>
|
You will notice, in the HTML, some gratuitous little touches like the fading gray table row gradient, but other than that it's fairly straightforward HTML. The basic EMBED tag syntax for each music file is exactly the same other than the fact that the SRC attribute refers to a different filename.
Notice how the HEIGHT of each player instance has been set with the statement HEIGHT=15. Beatnik automatically knows to select the top part of the control panel when this height is specified. Now, since the control panel has been set into SONG display with the statement DISPLAY=SONG, what the user sees in this slim panel layout is the transport control buttons that would normally appear at the top of the full control panel when it is in SONG display (see A Simple EMBED).
Incidentally, you can also force Beatnik to automatically select the bottom portion of the control panel by setting the height to 45 using the statement HEIGHT=45. The total of 15 and 45 is 60, which corresponds to the height of the full Beatnik Player control panel - 15 is the top and 45 is the bottom. You can see the bottom-only control panel layout in action in A Gratuitous Scope later on.